import { service } from '../index'
import { IhomeData, IlistData, IClassify, ICity } from '../typing'

type Res<T> = Promise<ItypeAPI<T>>;
// 一般情况下响应数据返回的这三个参数，
// 但不排除后端返回其它的可能性，
interface ItypeAPI<T> {
  msg: T; // 返回状态码的信息，如请求成功等
  code: number; //返回后端自定义的200，404，500这种状态码
}

//商品分类
export function shopGetClassify(data): Res<any> {
  return service.post<object>('/shop/getClassify',data)
}
//首页轮播图
export function shopCarousel(data): Res<any> {
  return service.post<object>('/shop/carousel',data)
}
//商品列表数据
export function shopGetGoodsList(data): Res<any> {
  return service.post<object>('/shop/getGoodsList',data)
}
//商品详情
export function shopGetGoodsInfo(data): Res<any> {
  return service.post<object>('/shop/getGoodsInfo',data)
}
//添加购物车
export function shopAddCart(data): Res<any> {
  return service.post<object>('/shop/addCart',data)
}
//购物车数量
export function shopCartNum(data): Res<any> {
  return service.post<object>('/shop/cartNum',data)
}
//购物车列表
export function shopCart(data): Res<any> {
  return service.post<object>('/shop/cart',data)
}
//删除购物车
export function shopCartDel(data): Res<any> {
  return service.post<object>('/shop/cartDel',data)
}
//清空购物车
export function shopCartAllDel(data): Res<any> {
  return service.post<object>('/shop/cartAllDel',data)
}
//修改购物车数量
export function shopCartSetNum(data): Res<any> {
  return service.post<object>('/shop/cartSetNum',data)
}
//确认订单
export function shopTrueOrder(data): Res<any> {
  return service.post<object>('/shop/trueOrder',data)
}
//添加订单
export function shopAddOrder(data): Res<any> {
  return service.post<object>('/shop/addOrder',data)
}
//收银台
export function shopCashier(data): Res<any> {
  return service.post<object>('/shop/cashier',data)
}
//拉起支付
export function shopOrderPay(data): Res<any> {
  return service.post<object>('/shop/orderPay',data)
}
//取消订单
export function shopCancelOrder(data): Res<any> {
  return service.post<object>('/shop/cancelOrder',data)
}
//订单列表数据
export function shopOrderList(data): Res<any> {
  return service.post<object>('/shop/orderList',data)
}
//获取运费
export function shopGetFreight(data): Res<any> {
  return service.post<object>('/shop/getFreight',data)
}
//订单详情：orderInfo
export function shopOrderInfo(data): Res<any> {
  return service.post<object>('/shop/orderInfo',data)
}
//物流追踪：orderLogistics
export function shopOrderLogistics(data): Res<any> {
  return service.post<object>('/shop/orderLogistics',data)
}
//更多包裹物流追踪：
export function shopMoreOrderLogistics(data): Res<any> {
  return service.post<object>('/shop/moreOrderLogistics',data)
}
//订单收货：receiving
export function shopReceiving(data): Res<any> {
  return service.post<object>('/shop/receiving',data)
}
 
 //售后列表：afterSalesList
 export function shopAfterSalesList(data): Res<any> {
   return service.post<object>('/shop/afterSalesList',data)
 }
//申请原因：afterSales
 export function shopAfterSales(data): Res<any> {
   return service.post<object>('/shop/afterSales',data)
 }
 //申请售后：afterSalesDo
 export function shopAfterSalesDo(data): Res<any> {
   return service.post<object>('/shop/afterSalesDo',data)
 }
 //售后订单详情：afterSalesInfo
 export function shopAfterSalesInfo(data): Res<any> {
   return service.post<object>('/shop/afterSalesInfo',data)
 }
 //售后取消：cancelAfterSales
 export function shopCancelAfterSales(data): Res<any> {
   return service.post<object>('/shop/cancelAfterSales',data)
 }
 //回寄发货：sendGoods
 export function shopSendGoods(data): Res<any> {
   return service.post<object>('/shop/sendGoods',data)
 }
 //售后物流追踪：afterSalesLogistics
 export function shopAfterSalesLogistics(data): Res<any> {
   return service.post<object>('/shop/afterSalesLogistics',data)
 }